cc.Class({
    extends: cc.Component,

    properties: {
        listLevelLayer: cc.ScrollView,
        prefabLevelLayer: cc.Prefab,
    },

    createLevelLayer(data) {
        let objLevelLayer = cc.instantiate(this.prefabLevelLayer);
        let levelLayerCom = objLevelLayer.getComponent("LevelLayer");
        levelLayerCom.setLevelData(data);
        this.listLevelLayer.content.addChild(objLevelLayer);
    },

    closePanel(event) {
        event.interactable = false;
        let self = this;
        if (!this.node.active) {
            return;
        }

        self.node.runAction(cc.sequence(
            cc.fadeOut(0.3),
            cc.removeSelf(),
        ));
    }
});